home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1 / Ian and Stuart's One (Australia).iso / Australasian Legends / Commercial / Rainbow Hill / MacDOS™ 2.0.0 / User's Guide / 03 Data on the Mac < prev    next >
Text File  |  1994-09-20  |  11KB  |  222 lines

  1. 3  Data on the Mac
  2.        The  purpose  of  this section of the  User's  Guide  is  to
  3.        introduce   you  to  how  the  Macintosh  Operating   System
  4.        organises  data. Nevertheless, many functions are  left  out
  5.        because  they  have  no visible effect on  MacDOS  (although
  6.        MacDOS  itself  is  aware of them!).  To  have  a  full  and
  7.        detailed  description  of the Macintosh  File  Manager,  you
  8.        should refer to Apple's Inside Macintosh volume series.
  9.  
  10. Volumes and Drives
  11.        Inside  Macintosh  Vol II defines a volume  as  a  piece  of
  12.        storage  medium  [...] formatted to contain files. Removable
  13.        media like floppies are volumes.
  14.  
  15.        When  you introduce a floppy into the floppy drive, the  Mac
  16.        OS  assigns  to  it a Volume Reference Number  and  forms  a
  17.        volume  record  to store information about the  floppy.  The
  18.        volume is then said to be "mounted" and "on-line".
  19.  
  20.        When  the  floppy  is trashed, the Mac OS frees  the  Volume
  21.        Reference  Number  and  the  memory  containing  the  volume
  22.        record.  The volume is then said to be "unmounted"  and  the
  23.        Mac  OS  completely forgets the floppy. Only  volumes  which
  24.        are on-line are fully accessible by applications.
  25.  
  26.        When  you eject the floppy (ie. when you type cmd-E and  the
  27.        icon  becomes  grey),  the  Mac  OS  releases  most  of  the
  28.        information  concerning the floppy but  retains  the  Volume
  29.        Reference  Number. The volume is then said to  be  "mounted"
  30.        but  "off-line".  When  an application  tries  to  access  a
  31.        volume  which is off-line, the Mac OS asks you to  re-insert
  32.        the floppy, so that it can be placed back on-line.
  33.  
  34.        If  you  boot  a  Mac from a hard disk, insert  one  floppy,
  35.        eject  it  with cmd-E, and then insert a second floppy,  the
  36.        Mac  OS  assigns  VRefNum 1 to the startup disk,  2  to  the
  37.        first floppy, and 3 to the second.
  38.  
  39.        If  you  then unmount volume 2 by trashing the icon  of  the
  40.        first  floppy, the Mac OS frees VRefNum 2 but does  not  re-
  41.        arrange  the  numbers. Therefore, the second floppy  remains
  42.        volume 3.
  43.  
  44.        Finally,  if you eject with cmd-E the second floppy  instead
  45.        of  trashing it and then insert another floppy, the  Mac  OS
  46.        re-uses   VRefNum  2.  In  other  words,  the  same   Volume
  47.        Reference  Number can be assigned to different  floppies  at
  48.        different times.
  49.  
  50.        A  drive  is  the physical device on which you can  mount  a
  51.        volume  (eg. a floppy disk drive). At startup,  the  Mac  OS
  52.        assigns  Drive Numbers to all drives and never changes  them
  53.        thereafter.  For  instance, the  internal  floppy  drive  is
  54.        always  drive 1, the external floppy drive is drive  2,  and
  55.        so  on.  Most Operating Systems (including DOS)  operate  on
  56.        Drive  Identifiers  (the  A:, C:,  etc  of  DOS,  which  are
  57.        effectively equivalent to the Macintosh Drive Numbers).
  58.  
  59.        Beside  never  changing, a Drive Number also  remains  valid
  60.        regardless of whether a floppy is ever mounted on the  drive
  61.        or not.
  62.  
  63.        Especially  if  you  are  an experienced  DOS  user,  it  is
  64.        important that you fully understand the differences  between
  65.        the two concepts of "volume" and "drive".
  66.  
  67. Folders
  68.        A folder is a collection of files and other folders.
  69.  
  70.        You  can use folders as if they really contained  files, and
  71.        the  desktop  metaphor reinforces this  view.  Nevertheless,
  72.        folders  are more like a telephone directory, in  that  they
  73.        contain  the  information necessary to find the  files  (ie.
  74.        the  people) rather than the files themselves. This  is  why
  75.        it  is  so  quick to move files from one folder to  another:
  76.        the  files  remain where they are and only a short directory
  77.        entry is moved.
  78.  
  79.        This  misconception  of  folders actually  containing  files
  80.        leads  to  the  concept  of  a "folder  size".  In  reality,
  81.        folders  have no size of their own. If you work with  System
  82.        7.0,  try  this:  empty the Trash, create an  empty  folder,
  83.        trash  it,  and then empty the Trash once more. The  Mac  OS
  84.        will  display  a  dialog box saying:  The Trash  contains  1
  85.        item. It uses zero K of disk space ...
  86.  
  87.        A  folder  name  can  contain up to 31 characters  and  most
  88.        ASCII characters are accepted.
  89.  
  90. Files
  91.        Again  from  Inside Macintosh Vol II: A  file  is  a  finite
  92.        sequence of numbered bytes.
  93.  
  94.        Macintosh  files can consist of two parts called forks:  the
  95.        data  fork  and  the  resource fork. These  two  parts  have
  96.        different functions and are usually accessed separately.
  97.  
  98.        The  resource  fork is the structured part  of  a  file  and
  99.        contains  objects  like menus, fonts, icons,  pictures,  and
  100.        code.  All application files have a resource fork. In  fact,
  101.        most applications have no data fork at all.
  102.  
  103.        The  data  fork  is  the unstructured part  of  a  file  and
  104.        contains  data  used  by applications, like  text,  database
  105.        records,   and  format  preferences.  Many  document   files
  106.        contain a data fork but no resource fork.
  107.  
  108.    File Names
  109.        A  file name can contain up to 31 characters and most  ASCII
  110.        characters are accepted.
  111.  
  112.    File Updates
  113.        For  each  file, the Mac OS remembers the date and  time  of
  114.        its  last  update.  Files are only considered  updated  when
  115.        their   content  is  changed.  Therefore,  operations   like
  116.        renaming,  changing of attributes, moving,  and  copying  do
  117.        not modify the date and time of the last update.
  118.  
  119.    File Finder Attributes
  120.        The Mac OS keeps data concerning the appearance of files  on
  121.        the  desktop.  This information is stored in records  called
  122.        "Finder Info"s, and each file has its own FInfo record.  The
  123.        fields  which you need to know in order to work with  MacDOS
  124.        are:
  125.  
  126.        File Creator
  127.          The  Creator  of an application identifies the application
  128.           itself.   The  Creator  of  a  document  identifies   the
  129.           application  which  created it. In practical  terms,  the
  130.           Creator  of  a  document determines which application  is
  131.           launched when you double click on the document icon.
  132.  
  133.          All  creators are registered with Apple, so that they  are
  134.           unique.  They  consist of four characters  and  are  case
  135.           sensitive.  For instance, MacDOS' creator is  'mDOS'  and
  136.           Teach Text's is 'ttxt'. The Creator '????' is often  used
  137.           to  identify  files  which were created  by  unregistered
  138.           applications.
  139.  
  140.        File Type
  141.          The  Type  of a file identifies its function. It  consists
  142.           of four characters and is case sensitive.
  143.  
  144.          Apple   has   defined  some  standard  types  which   many
  145.           applications use. For example: plain ASCII files  are  of
  146.           type  'TEXT'  and  applications are of  type  'APPL'.  In
  147.           addition,  many  applications define special  file  types
  148.           for their own use.
  149.  
  150.          The  Finder  uses Creator and File Type to determine  what
  151.           icon to display for a particular file.
  152.  
  153.        Creators & Types Relevant for MacDOS
  154.        •  Creator 'mDOS'; type 'APPL'
  155.           The MacDOS application file.
  156.        •  Creator 'mFLR'; type 'APPL'
  157.           Applications  that can operate as MacDOS  extensions  and
  158.           interact with MacDOS through pipes.
  159.        •  Creator 'ToyS'; type 'TEXT'
  160.           Text AppleScripts that can be executed.
  161.        •  Creator 'mDOS'; type 'TEXT'
  162.           Batch  files  that can automatically launch  MacDOS  when
  163.           double-clicked.
  164.        •  Creator 'ttxt'; type 'TEXT'
  165.           Text  files  created  by TeachText.  By  default,  MacDOS
  166.           creates all text files with this creator.
  167.        •  Creator 'hhgg'; type 'INIT'
  168.           File   sharing  extension,  to  be  switched  off  before
  169.           quitting the Finder.
  170.        •  Creator 'MACS'
  171.           The creator of the Finder.
  172.        •  Type 'APPL'
  173.           Generic applications that can be launched.
  174.        •  Type 'osas'
  175.           Compiled AppleScripts than can be executed.
  176.        •  Type 'TEXT'
  177.           Generic  text  files used for I/O redirection  or  to  be
  178.           executed as batch files from within MacDOS.
  179.  
  180.        Hidden Flag
  181.          Within  the  FInfo record, a flag determines  whether  the
  182.           icon  of  the file is to be displayed on the  desktop  or
  183.           not.  This flag is used to protect system files and other
  184.           files  which should not be accessed with the mouse during
  185.           normal operations.
  186.  
  187.          Usually,  you  can access the hidden flag through  special
  188.           applications  like ResEdit. MacDOS lets you  list  hidden
  189.           files  and work with them. It also lets you easily toggle
  190.           the hidden flag with the command REN/H.
  191.  
  192. Aliases
  193.        Aliases  are  files which store the location of other  items
  194.        like  files,  folders, and floppies. Apple  introduced  them
  195.        with System 7.0 .
  196.  
  197.        In  most  cases,  you can use an alias as  if  it  were  the
  198.        corresponding  target,  because  the  Mac   OS   hides   the
  199.        connection and automatically refers to the target.
  200.  
  201.        The  way  in  which MacDOS handles aliases can be summarised
  202.        as follows:
  203.  
  204.          •    The  DIR  command,  which lists  the  contents  of  a
  205.           folder,  handles  aliases as if they  were  normal  files
  206.           except  when  the user applies the command  to  a  single
  207.           aliased folder. In that case, DIR resolves the alias  and
  208.           lists  the  contents of the target folder.  In  lists  of
  209.           filenames,  aliases produce double entries which  provide
  210.           information on both the alias itself and the target.
  211.  
  212.          •     Commands  which  operate  on  files  always   handle
  213.           aliases  like  files,  so that aliases  can  be  renamed,
  214.           copied,  and  deleted  like normal files,  regardless  of
  215.           whether they have as target a file or a folder.
  216.  
  217.          •    Commands  which operate on folders fail when  applied
  218.           to  an  aliased folder, with one exception: CHDIR applied
  219.           to  an  aliased folder resolves the alias  and  sets  the
  220.           default directory to be the target folder.
  221.  
  222.